﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Orion.MyLib
{
	public class Logger
	{
		private List<LogMedia> m_logger = new List<LogMedia>();

		public Logger()
		{
			m_logger.Add(new OutputWindowLogMedia());
			m_logger.Add(new TextFileLogMedia());
			//m_logger.Add(new EmailLogMedia());
		}

		public void LogExcepion(Exception ex)
		{
			string stMsg = string.Format("Time: {0}\nMessage: {1}\nStacktrace: {2}", DateTime.Now, ex.Message, ex.StackTrace);

			foreach (var logMedia in m_logger)
			{
				logMedia.LogMessage(stMsg);
			}
		}
	}
}